import React, { createContext, useContext, ReactNode } from 'react'
import './index.scss'
interface GlobalContextType {
  
}

const globalContext = createContext<GlobalContextType | null>(null)

interface GlobalProviderProps {
  children: ReactNode
}
export const GlobalProvider: React.FC<GlobalProviderProps> = ({ children }) => {



  // 统一导出 暴露配置修改函数
  const contextValue: GlobalContextType = {
    
  }

  return (
    <globalContext.Provider value={contextValue}>
      {children}
      {/* 单例模式 全局公共组件 */}

    </globalContext.Provider>
  )
}

export const useGlobal = () => {
  const context = useContext(globalContext)
  if (!context) {
    throw new Error('useDialog must be used within a GlobalProvider')
  }
  return context
}
